
# str = '3,6,9'
# str2 = str.split(',')
# print(str2)
# print(':'.join(str2))
#
# list1=[1,2,3]
# list2=[4,5,6]
# for x,y in zip(list1,list2):
#     print(x,y)

# print('%d,%x' %(65,65))
#
# print('%d,%2x' %(65,15))

from itertools import groupby  #分组函数(要求数据排好序)
list1 = [1,2,3,4,5,6,7,8,9]
def splitScore(score):
    if score>=8:
        return '优'
    elif score>=3:
        return '及格'
    else:
        return '不及格'
result = groupby(list1,key=splitScore)
for item in result:
    print(item)
